home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Development Platforms / CSMP Digests / csmp-v1-015.txt < prev    next >
Encoding:
Text File  |  1992-11-18  |  55.2 KB  |  1,605 lines  |  [TEXT/MPS ]

  1. C.S.M.P. Digest             Fri, 13 Mar 92       Volume 1 : Issue 15
  2.  
  3. Today's Topics:
  4.  
  5.      How do I grey out a 'static text' item in a DLOG?
  6.     Prograph Summary
  7.     GetNewMBar causes bus errors?
  8.     ETO#6 ships
  9.     Graf3d question
  10.     TCL Application projects
  11.     DiskVars / JRdData  ($22E)
  12.     My INIT and cdev don't talk to each other!
  13.  
  14.  
  15. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  16.  
  17. These digests are available (by using FTP, account anonymous, your email
  18. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  19. edu (try skinner.cs.uoregon.edu if that doesn't work).  This is also the home
  20. of the comp.sys.mac.programmer Frequently Asked Questions list.
  21.  
  22. These digests are also available via email.  Just send a note saying that you
  23. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  24. automatically receive each new digest as it is created.
  25.  
  26. The articles in these digests are taken directly from comp.sys.mac.programmer.
  27. They are not edited; all articles included in this digest are in their original
  28. posted form.  The only articles that are -not- included in these digests are
  29. those which didn't receive any replies (except those that give information
  30. rather than ask a question).  All replies to each article are concatenated
  31. onto the original article in the order in which they were received.  Article
  32. threads are not added to the digests until the last article added to the
  33. thread is at least one month old (this is to ensure that the thread is dead
  34. before adding it to the digests).
  35.  
  36. Send administrative mail to mkelly@cs.uoregon.edu.
  37.  
  38. -------------------------------------------------------
  39.  
  40. From: KURZAEV@JONATHAN.srcc.msu.su
  41. Subject:  How do I grey out a 'static text' item in a DLOG?
  42. Date: 25 Jan 92 19:55:16 GMT
  43. Organization: Research Computing Center, Moscow State University
  44.  
  45. In article <10338@cs.tulane.edu>
  46. mandel@vax.anes.tulane.edu (mandel@vax.anes.tulane.edu (Jeff E Mandel)) writes:
  47. >To give your app that System 7 look, check the pixel Depth, and if 8 (or
  48. >greater), do this:
  49. >
  50. >        RGBColor fc,gray={0x9999,0x9999,0x9999};
  51. >        GetForeColor(&fc);
  52. >        RGBForeColor(&gray);
  53. >        DrawText (&itemData, 0, dataLen);
  54. >        RGBForeColor(&fc);
  55.  
  56. I think there is a better way of getting something gray. If you want to  gray
  57.  a text there's a special text mode in System7 (textGrayishOr = 49).  Or  you
  58.  can use the following algorithm.
  59.  
  60. Suppose you want to "gray" something in the rect 'rect'
  61.  
  62. void MakeGray(???)
  63. {
  64.   RGBColor fColor, bColor;
  65.   Rect     rect;
  66.  
  67.   GetForeColor(&fColor); GetBackColor(&bColor);
  68.   if (GetGray(GetMaxDevice(&rect), &fColor, &bColor)) {
  69.     RGBForeColor(&fColor);
  70.     DrawSmth();
  71.   }
  72. }
  73.  
  74. Believe this would help, if you could only understand my English
  75. Paul Kurzaev
  76. Russia, Moscow University Computer Center
  77. AppleLink: MOSCOW.UNIV
  78. eMail:     KURZAEV@JONATHAN.srcc.msu.su
  79.  
  80.  
  81.  
  82. ---------------------------
  83.  
  84. From: winter@idicl1.idi.battelle.org (Eric Winter)
  85. Subject: Prograph Summary
  86. Date: 6 Feb 92 14:55:04 GMT
  87. Organization: Information Dimensions, Inc.
  88.  
  89. A couple of weeks ago I posted a request for experiences with Prograph 2.5.
  90. Below is a summary of the responses I received as promised.
  91.  
  92. Tim Bates writes:
  93.    >Eric,
  94.    >Prograph is great. If you are interested in it you may want to
  95.    >be know that there is a usenet mail list for prographers the address
  96.    >for subscriptions is:
  97.    >
  98.    >
  99.    >info-prograph-request@grove.iup.edu
  100.    >
  101.    >The TGS people are also contactable over the net.
  102.  
  103. James J. Coons writes:
  104.    >I have used Prograph since its first release and I  very highly recommend 
  105.    >it. It is fully object oriented unlike Serius. Unlike Serius Prograph is 
  106.    >a complete programming language with complete access to Macintosh Toolbox. 
  107.    >It was selected as the best Macintosh development system by MacUser 2 
  108.    >years ago and has been improved greatly since then. It was nominated again 
  109.    >this year for the best development system, and really should win since it 
  110.    >is much better than any other development system out.  The company
  111.    >which produced it TGS  provides excellent support.  It is fully system 
  112.    >7 compatable, supporting all system 7 features.  With inexpensive add ons 
  113.    >you can use external code written in C, Pascal or Fortran if you need to.  
  114.    >In my opinion Prograph is the best tool available on any computer in any 
  115.    >category! Also every other person I know who has used it agrees with that 
  116.    >assessment. Highly Recommended. The current version 2.5 supplies a
  117. database 
  118.    >engine a class library of interface objects (Somewhat similar to
  119. MacApp 
  120.    >or TCL). Prograph is a visual, object-oriented, data-flow language.
  121. It is 
  122.    >very interactive, For instance you can graphically edit your user
  123. interface,
  124.    >or change your code, even while you are in the middle of an
  125. execution. If 
  126.    >you change code in a routine which you have already executed it will
  127. just 
  128.    >roll back the execution to that point and continue.  It has a full
  129. 680x0 
  130.    >compiler, interpreter/editor.  It is very bug free, the language is
  131. fun. 
  132.    >What more can I say. Contact TGS at:
  133.    >
  134.    >   Voice:          800-565-1978 or 902-455-4446
  135.    >   Fax :           902-455-2246
  136.    >   Address:        2745 Dutch Village Road, Suite 200
  137.    >                   Halifax, Nova Scotia, 
  138.    >                   Canada B3L 4G7
  139.    >   Apple Link:     TGS.Systems
  140.    >   America Online: Prographer    
  141.    >   Compuserve:     73300,3460
  142.    >   EMail:            gunakara@tuns.ca
  143.    >   Modem:          902-455-6616    
  144.    >
  145.    >I have no conection with TGS except as a very satisfied customer.
  146.    >James J. Coons
  147.    >coons@cupid.med.ge.com
  148.  
  149. Robert Patt-Corner writes:
  150.    >From: nimbus!rpcfod@uunet.uu.net (Robert Patt-Corner)
  151.    >
  152.    >In article <1992Jan5.161902.12370@seas.gwu.edu>, viraf@seas.gwu.edu 
  153.    >(Viraf Bankwalla) writes:
  154.    >> 
  155.    >> Hi,
  156.    >> 
  157.    >>   Has anyone used Serius Programmer/Developer and/or Prograph ?
  158.    >> 
  159.    >>   What is the difference between the two ?  What languages do they
  160.    >>   support ?  How extensive are the modules provided by them ? ....
  161.    >
  162.    >
  163.    >I've very minimally looked at S/Prog and Prograph.  More serious
  164. discussions
  165.    >can be found in MACDEV on Compuserve.
  166.    >
  167.    >The main difference I see is in their level of granularity. 
  168. Prograph is a
  169.    >real programming environment, and its primitives are fairly
  170. primitive.  This
  171.    >makes it harder to build something that works, and far easier to
  172. build 
  173.    >something that you like or want or need.
  174.    >
  175.    >Serius supplies more fully formed objects at a lower level of
  176. granularity.
  177.    >Easier to cobble them together, harder to do what you want to do.
  178.    >
  179.    >Both have the liability of being non-portable.
  180.    >
  181.   
  182. >/*---------------------------------------------------------------------
  183. - ----*/
  184.    >From: ricardo@husc.harvard.edu
  185.    >
  186.    >In article <1992Jan5.161902.12370@seas.gwu.edu> you write:
  187.    >>Hi,
  188.    >>
  189.    >>  Has anyone used Serius Programmer/Developer and/or Prograph ?
  190.    >>
  191.    >>  What is the difference between the two ?  What languages do they
  192.    >>  support ?  How extensive are the modules provided by them ? ....
  193.    >>
  194.    >>  Any info on the above would be appreciated.
  195.    >>
  196.    >>  Thanks in advance.
  197.    >>
  198.    >>  viraf bankwalla
  199.    >>  viraf@seas.gwu.edu
  200.    >>  ...!uunet!gwusun!viraf
  201.    >
  202.    >I have purchased Serius. I am not really happy with it. You
  203.    >can not create runtime objects, so that any application built
  204.    >with it can not build new windows, for instance. What if the
  205.    >user wants to keep hitting cmd-N for new windows within your
  206.    >application? That would be a problem. Other SERIUS limitations
  207.    >include an iconic metaphor which is not well-handled. You end
  208.    >up with a lot of spaghetti-looking connections on your screen.
  209.    >The startup sequence takes forever. There are many
  210.    >limitations. I just use SuperCard 1.6 , which is by FAR the
  211.    >most expandable, error-tolerant, and flexible tool for quick,
  212.    >functional applications.
  213.    >    I would love to try ProGraph, but I can not afford it
  214.    >right now. Perhaps in a month or 2 I can share with you
  215.    >something about it. It Does have an obj-oriented structure
  216.    >which is much more hierarchical than SERIUS, but that also
  217.    >means that the developer must be a bit more savvy in his/her
  218.    >development specifications. Good Luck!
  219.    >
  220.    >    warm regards,
  221.    >    Frank Ricardo
  222.  
  223.  
  224. --
  225. Eric Winter, Software Developer
  226. Information Dimensions, Inc.
  227. 5080 Tuttle Crossing Blvd.
  228. Dublin, OH  43017
  229.  
  230.  
  231.  
  232. ---------------------------
  233.  
  234. From: J.Cook@ENS.Prime.COM (Jim Cook)
  235. Subject: GetNewMBar causes bus errors?
  236. Date: 27 Jan 92 02:03:43 GMT
  237. Organization: Prime Computer, Inc.
  238.  
  239. Okay, this used to work under Think 4.0.  Now it fails under Think 5.0.
  240.  
  241. I am writing my first original(!) Mac application using Think C 5.0 on
  242. my Mac IIx running 6.0.3.  I get hung up at the call to GetNewMBar with
  243. a bus error.  Heck if I can figure it out.  So I go find the "Timer" program
  244. from Cartwright & Reed (Mac Programming Primer in Think C) which does this
  245. and worked fine last I checked when I had 4.0.  I recompile it as it was last
  246. compiled under 4.0, correct a few mistakes (a few typecasts are now necessary),
  247. and bam, it now fails the same way.  So I go to work, put it on my Mac II
  248. running Think C 5.0 under 7.0.  I even force a recompile.  Bam, same problem
  249. again.
  250.  
  251. There must be something simple I am missing here.
  252. (I'll leave it until after I know the answer before I decide whether or not
  253. to flame about running into it).
  254.  
  255. Thanks,
  256. Jim
  257. <J.Cook@ENS.Prime.COM>
  258.  
  259.  
  260.  
  261.  
  262. - -------------------------
  263.  
  264. From: overdriv@tsoft.sf-bay.org (Paul A. Pelton)
  265. Subject:  GetNewMBar causes bus errors?
  266. Date: 28 Jan 92 02:30:05 GMT
  267. Organization: The TeleSoft BBS and Public Access Unix, +1 415 969 7958
  268.  
  269. Can you post a sample of the offending code? I'd be interested to see what's
  270. going on. Also, check to make sure that the MBAR resource is actually there
  271. (obvious, I know).
  272.  
  273. Paul
  274.  
  275.  
  276.  
  277. - -------------------------
  278.  
  279. From: J.Cook@ENS.Prime.COM (Jim Cook)
  280. Subject:  GetNewMBar causes bus errors?
  281. Date: 28 Jan 92 14:33:52 GMT
  282. Organization: Prime Computer, Inc.
  283.  
  284. In article <1992Jan27.020343.17230@primerd.prime.com> I wrote:
  285.  
  286. >Okay, this used to work under Think 4.0.  Now it fails under Think 5.0.
  287. >
  288. >I am writing my first original(!) Mac application using Think C 5.0 on
  289. >my Mac IIx running 6.0.3.  I get hung up at the call to GetNewMBar with
  290. >a bus error.  Heck if I can figure it out.  So I go find the "Timer" program
  291. >from Cartwright & Reed (Mac Programming Primer in Think C) which does this
  292. >and worked fine last I checked when I had 4.0.  I recompile it as it was last
  293. >compiled under 4.0, correct a few mistakes (a few typecasts are now
  294. necessary),
  295. >and bam, it now fails the same way.  So I go to work, put it on my Mac II
  296. >running Think C 5.0 under 7.0.  I even force a recompile.  Bam, same problem
  297. >again.
  298.  
  299. The answers to these problems are as follows:
  300.  
  301. >From America On-Line (AOL), I downloaded a file describing the changes
  302. necessary to run Macintosh Programming Primer programs under Think 5.0.
  303. For the Timer program, there were a few casts to be added (which I had
  304. already figured out from the compiler error messages) and a #include of
  305. "Packages.h" at the top.  The include solved the problem in Timer with
  306. GetNewMBar, although I don't know why.  The purpose of include was to
  307. declare some GetIUString routines used with getting the time.  I don't
  308. think these routines had not been called (or miscalled when Packages 
  309. wasn't there) yet when GetNewMBar was called, so nothing was messed up 
  310. yet, so why was GetNewMBar failing?  <Shrug>.
  311.  
  312. With regard to my problem, based on my previous compiler experience, I
  313. created a small test program - just a bunch of init calls (InitGraf, etc.)
  314. and the call to GetNewMBar.  When I pasted in the resources from Timer,
  315. it worked.  When I pasted in the resources from my program, it failed.
  316. A mention of this problem in a call to Symantec tech support produced
  317. the quick response that there is a bug in ResEdit 2.1.1.  Sure enough,
  318. open up your menu bar resources.  Double click on resource 129.  Now
  319. pull down "Get MENU & MDEF info..." from MENU on the menu bar.  It says
  320. the MENU id is 401 (not 129), and the MDEF number is 1 (not 0).  Gee, 
  321. that's not what the earlier menus said...
  322.  
  323. The minor flame I have here is that GetNewMBar should not fall over with
  324. a bus error or a divide by zero or ... when it fails due to missing MENU
  325. resources or references to non-existant MDEF resources in MENU resources.
  326. It should simply return a null pointer.
  327.  
  328. Thanks to all and Symantec,
  329. Jim
  330. <J.Cook@ENS.Prime.COM>
  331.  
  332.  
  333.  
  334. - -------------------------
  335.  
  336. From: sr0o+@andrew.cmu.edu (Steven Ritter)
  337. Subject:  GetNewMBar causes bus errors?
  338. Date: 28 Jan 92 16:15:27 GMT
  339. Organization: Doctoral student, Psychology, Carnegie Mellon, Pittsburgh, PA
  340.  
  341. >The minor flame I have here is that GetNewMBar should not fall over with
  342. >a bus error or a divide by zero or ... when it fails due to missing MENU
  343. >resources or references to non-existant MDEF resources in MENU resources.
  344. >It should simply return a null pointer.
  345.  
  346. This would be a minor flame if it was only GetNewMBar that failed to
  347. check for errors, but the entire Mac OS is written this way.  Any
  348. routine that allocates memory will crash if it can't find the memory
  349. (you only get error #25 if you're lucky).  How hard would it be to
  350. return a null pointer if a NewXXX routine couldn't get memory?  Pass a
  351. bad argument to just about any system call, and you're playing with
  352. fire.  God forbid you should call InvalRect when the current GrafPort is
  353. not a window.
  354.  
  355. All of this stuff wouldn't be too bad if there was protected memory and
  356. your program simply crashed, but, on the Mac, one bad program does spoil
  357. the whole bunch.
  358.  
  359. Steve
  360.  
  361.  
  362.  
  363. - -------------------------
  364.  
  365. From: neeri@iis.ethz.ch (Matthias Ulrich Neeracher)
  366. Subject:  GetNewMBar causes bus errors?
  367. Date: 29 Jan 92 14:18:33 GMT
  368. Organization: Integrated Systems Laboratory, ETH, Zurich
  369.  
  370. In article <UdVM6TS00WBM01ywch@andrew.cmu.edu> sr0o+@andrew.cmu.edu (Steven Ritter) writes:
  371. >This would be a minor flame if it was only GetNewMBar that failed to
  372. >check for errors, but the entire Mac OS is written this way.  Any
  373. >routine that allocates memory will crash if it can't find the memory
  374. >(you only get error #25 if you're lucky). How hard would it be to
  375. >return a null pointer if a NewXXX routine couldn't get memory?
  376.  
  377. Most NewXXX calls do exactly that, last time I checked.
  378.  
  379. >Pass a
  380. >bad argument to just about any system call, and you're playing with
  381. >fire.  God forbid you should call InvalRect when the current GrafPort is
  382. >not a window.
  383.  
  384. There's only so much checking you can reasonably do. I don't think you'd want
  385. to use a Mac with *really* strict error checking. Every QuickDraw routine would
  386. begin by checking that A5 is even and points to an address in the heap. Then,
  387. it would have to check that A5^ is even and points to an address in the heap...
  388. you get the idea. As soon as an Operating System puts major data structures
  389. (GrafPorts, TERecs) in unprotected memory, total error checking is no longer
  390. realistic.
  391.  
  392. >All of this stuff wouldn't be too bad if there was protected memory and
  393. >your program simply crashed, but, on the Mac, one bad program does spoil
  394. >the whole bunch.
  395.  
  396. To be fair, you should mention that MultiFinder has improved in getting rid of
  397. crashed applications. A bus error usually is not much of a problem.
  398.  
  399. Matthias
  400.  
  401. - ---
  402. Matthias Neeracher                                   neeri@iis.ethz.ch
  403.  "You must have picked up that copy of Scarlett instead of Inside Mac
  404.   when you tried to find the right call..." -- Keith Rollin
  405.  
  406.  
  407.  
  408. - -------------------------
  409.  
  410. From: Pete.Gontier@p811.f70.n109.z1.FidoNet.Org (Pete Gontier)
  411. Subject:  GetNewMBar causes bus errors?
  412. Date: 31 Jan 92 04:50:13 GMT
  413.  
  414.  
  415.  MU> In article <UdVM6TS00WBM01ywch@andrew.cmu.edu> sr0o+@andrew.cmu.edu
  416.  MU> (Steven Ritter) writes:
  417.  
  418.  MU> >This would be a minor flame if it was only GetNewMBar that failed to
  419.  MU> >check for errors, but the entire Mac OS is written this way...
  420.  
  421.  MU> >Pass a bad argument to just about any system call, and you're playing
  422.  MU> >with fire.
  423.  
  424.  MU> There's only so much checking you can reasonably do. I don't think you'd
  425.  MU> want to use a Mac with *really* strict error checking. Every 
  426.  MU> QuickDraw routine would begin by checking that A5 is even and points
  427.  MU> to an address in the heap...
  428.  
  429. Ack! Certainly not.
  430.  
  431. It's not the responsibility of a routine to make sure
  432. it's called in the right context. That's the caller's problem. What irks
  433. me is that when GetNewDialog returns nil, there's any of a zillion reasons
  434. why, and all I can do is dumbly return a kNilPointerErr. Every time I do
  435. it, I think "Boy, the user'll really love THIS one..." Unless the program
  436. can tell the user what went wrong, there is 0% chance the user can help
  437. recover from the error.
  438.  
  439.  MU> As soon as an Operating System puts major data structures
  440.  MU> (GrafPorts, TERecs) in unprotected memory, total error checking is no
  441.  MU> longer realistic.
  442.  
  443. If you're talking about total error checking of the kind used in software
  444. for medical equipment, you're right. They do real fun stuff like range-check
  445. two numbers before adding them together -- as a matter of course.
  446. ("Whoever calls this routine could be an idiot, and someone's life is in
  447. the balance -- let's check the parameters.") But for Macintosh
  448. business application software and the like, I think it's better to simply
  449.    1) commit your soul to good code
  450.    2) debug
  451.  * Origin: EC Technology, Santa Barbara, CA (1:109/70.811)
  452.  
  453.  
  454.  
  455. - -------------------------
  456.  
  457. From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
  458. Subject:  GetNewMBar causes bus errors?
  459. Date: 2 Feb 92 11:59:35 GMT
  460. Organization: Royal Institute of Technology, Stockholm, Sweden
  461.  
  462. > Pete.Gontier@p811.f70.n109.z1.FidoNet.Org (Pete Gontier) writes:
  463.  
  464.     MU> want to use a Mac with *really* strict error checking. Every 
  465.     MU> QuickDraw routine would begin by checking that A5 is even and points
  466.     MU> to an address in the heap...
  467.  
  468.    it's called in the right context. That's the caller's problem. What irks
  469.    me is that when GetNewDialog returns nil, there's any of a zillion reasons
  470.    why, and all I can do is dumbly return a kNilPointerErr. Every time I do
  471.  
  472. How about
  473.  
  474. Boolean
  475. ValidateDialog ( long type , short ID )
  476. {
  477.     Handle h ;
  478.  
  479.     if ( ! GetResource ( type , ID ) ) {
  480.         return 0 ;
  481.     }
  482.     if ( ! GetResource ( 'DITL' , ID ) ) {
  483.         return 0 ;
  484.     }
  485.  
  486.     return 1 ;
  487. }
  488.  
  489. which does a simple test. Then check if memory is OK (less than
  490. 2 ks contigous and you could be sure it's memory)
  491.  
  492. --
  493. This Signature is distributed under the conditions of the Signature License,
  494. available at a fee from   h+@nada.kth.se  (Jon W{tte)  Reading the Signature
  495. implies that you accept to be bound by the terms in said License. Should you
  496. not agree on any of these terms, you must return the Signature unread to me.
  497.  
  498.  
  499.  
  500. - -------------------------
  501.  
  502. From: wieser@acs.ucalgary.ca (Bernie Wieser)
  503. Subject:  GetNewMBar causes bus errors?
  504. Date: 2 Feb 92 17:58:19 GMT
  505. Organization: The University of Calgary, Alberta, Canada
  506.  
  507. So why isn't ResError being checked?  My code usually looks like
  508.     somehandle = SomResourceCall();
  509.     if(!(err=ResError()) && somehandle)
  510.         {
  511.         BarfError(err);
  512.         }
  513. You could even add another brick with MemError().
  514.  
  515.  
  516. -- 
  517.  
  518.  
  519.  
  520. - -------------------------
  521.  
  522. From: keith@Apple.COM (Keith Rollin)
  523. Subject:  GetNewMBar causes bus errors?
  524. Date: 3 Feb 92 18:24:03 GMT
  525. Organization: Apple Computer Inc., Cupertino, CA
  526.  
  527. In article <D88-JWA.92Feb2125935@hemul.nada.kth.se> d88-jwa@hemul.nada.kth.se (Jon W{tte) writes:
  528. >> Pete.Gontier@p811.f70.n109.z1.FidoNet.Org (Pete Gontier) writes:
  529. >
  530. >   What irks
  531. >   me is that when GetNewDialog returns nil, there's any of a zillion reasons
  532. >   why, and all I can do is dumbly return a kNilPointerErr. Every time I do
  533. >
  534. >How about
  535. >
  536. >Boolean
  537. >ValidateDialog ( long type , short ID )
  538. >{
  539. >    Handle h ;
  540. >
  541. >    if ( ! GetResource ( type , ID ) ) {
  542. >        return 0 ;
  543. >    }
  544. >    if ( ! GetResource ( 'DITL' , ID ) ) {
  545. >        return 0 ;
  546. >    }
  547. >
  548. >    return 1 ;
  549. >}
  550. >
  551. >which does a simple test. Then check if memory is OK (less than
  552. >2 ks contigous and you could be sure it's memory)
  553.  
  554. Necessary, but not sufficient. You also have to check for all the
  555. CDEF's, icons, PICTs, dctb's, ictb's, actb's, pllt's, etc., to be
  556. loaded, and for all the control records, window records, text edit
  557. records, etc., to be created.
  558.  
  559. -- 
  560. - ----------------------------------------------------------------------------
  561. Keith Rollin           ---            <Taligent .signature under construction>
  562. Disclaimer: Pretty soon, I really _won't_ be speaking for Apple...
  563.  
  564.  
  565.  
  566. - -------------------------
  567.  
  568. From: heksterb@cs.utwente.nl (Ben Hekster)
  569. Subject:  GetNewMBar causes bus errors?
  570. Date: 5 Feb 92 16:40:58 GMT
  571. Organization: University of Twente, Dept. of Computer Science
  572.  
  573. In article <62422@apple.Apple.COM> keith@Apple.COM (Keith Rollin) writes:
  574. [...]
  575. >Necessary, but not sufficient. You also have to check for all the
  576. >CDEF's, icons, PICTs, dctb's, ictb's, actb's, pllt's, etc., to be
  577. >loaded, and for all the control records, window records, text edit
  578. >records, etc., to be created.
  579.  
  580. I noticed that under 7.0, CouldDialog and CouldAlert are also no longer
  581. supported.  These could have been useful on 7.0 machines like the
  582. PowerBooks, to ensure in advance that certain dialogs which are likely to
  583. be needed do not wake up the sleeping hard disk later.
  584.  
  585. -- 
  586. Ben `Hackster' Hekster            | sigblock(sigmask(SIGFLAME));
  587. heksterb@cs.utwente.nl            | "Here we are now, entertain us"
  588.  
  589.  
  590.  
  591. - -------------------------
  592.  
  593. From: Pete.Gontier@p811.f70.n109.z1.FidoNet.Org (Pete Gontier)
  594. Subject:  GetNewMBar causes bus errors?
  595. Date: 11 Feb 92  01:13:30 EST
  596.  
  597.  JW> From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
  598.  
  599.  PG> What irks me is that when GetNewDialog returns nil, there's any of
  600.  PG> a zillion reasons why, and all I can do is dumbly return a
  601.  PG> kNilPointerErr.
  602.  
  603.  JW> How about
  604.  JW> 
  605.  JW> Boolean
  606.  JW> ValidateDialog ( long type , short ID )
  607.  JW> {
  608.  JW>     Handle h ;
  609.  JW> 
  610.  JW>     if ( ! GetResource ( type , ID ) ) {
  611.  JW>         return 0 ;
  612.  JW>     }
  613.  JW>     if ( ! GetResource ( 'DITL' , ID ) ) {
  614.  JW>         return 0 ;
  615.  JW>     }
  616.  JW> 
  617.  JW>     return 1 ;
  618.  JW> }
  619.  
  620.  JW> which does a simple test. Then check if memory is OK (less than
  621.  JW> 2 ks contigous and you could be sure it's memory)
  622.  
  623. You *can* do this sort of thing. There's nothing wrong with it.
  624. It's useful. You can also set up a ResErrProc which reports errs via
  625. globals. It doesn't go far enough, of course. What if NewWindow or
  626. NewControl fails? If and when they do, why did they? (I suppose I
  627. shouldn't whine about this problem recursively, though.)
  628.  
  629. But more importantly, this sort of check misses the point. Only
  630. GetNewDialog knows of all the possible errors that it might cause.
  631. *I* shouldn't know. Not because of some magical allegiance to Apple's
  632. authority on the matter, but because it's simply good design practice.
  633.  
  634. The EC in my tagline stands for "Error Checking." I'm a fanatic. The
  635. toolbox should always return an error to me. It doesn't, and belly-aching
  636. about it won't help. The sad part is that Pink won't be any better.
  637. Anybody want to give me a job writing an OS from scratch?
  638.  
  639.  * Origin: EC Technology, Santa Barbara, CA (1:109/70.811)
  640.  
  641.  * Origin: EC Technology, Santa Barbara, CA (1:109/70.811)
  642.  
  643.  
  644.  
  645. - -------------------------
  646.  
  647. From: Pete.Gontier@p811.f70.n109.z1.FidoNet.Org (Pete Gontier)
  648. Subject:  GetNewMBar causes bus errors?
  649. Date: 11 Feb 92  01:14:18 EST
  650.  
  651.  BW> From: wieser@acs.ucalgary.ca (Bernie Wieser)
  652.  
  653.  BW> > So why isn't ResError being checked?  My code usually looks like
  654.  BW> >    somehandle = SomResourceCall();
  655.  BW> >    if(!(err=ResError()) && somehandle)
  656.  BW> >        {
  657.  BW> >        BarfError(err);
  658.  BW> >        }
  659.  
  660.  BW> You could even add another brick with MemError().
  661.  
  662. Not such a hot idea. ResError has returned memory manager errors for
  663. a long time now. If MemError is non-zero after a resource call, there's
  664. no documented reason why.
  665.  
  666.  * Origin: EC Technology, Santa Barbara, CA (1:109/70.811)
  667.  
  668.  * Origin: EC Technology, Santa Barbara, CA (1:109/70.811)
  669.  
  670.  
  671.  
  672. ---------------------------
  673.  
  674. From: ksand@apple.com (Kent Sandvik)
  675. Subject: ETO#6 ships
  676. Date: 4 Feb 92 18:54:04 GMT
  677. Organization: MacDTS Mongols
  678.  
  679. Apologies if this sounds like advertisement, but I guess this
  680. note is of some help to our developers, Kent:
  681.  
  682. - ----
  683. Sub:    E.T.O. #6 Ships from APDA
  684.  
  685. The following product has started shipping from APDA:
  686.  
  687. Title:      E.T.O.: Essentials Tools Objects #6
  688. - -------------------------------------------------
  689. Description:
  690. E.T.O. is the most complete and comprehensive collection of Apple development
  691. tools ever combined in one package.  E.T.O. contains all the most widely used
  692. Apple development tools on a CD-ROM disc, with hardcopy final documentation,
  693. and is sold as a four-issue subscription.  E.T.O. includes:
  694. - MPW development environment
  695. - MacApp application framework
  696. - MPW C++
  697. - MPW C
  698. - MPW Object Pascal
  699. - MPW Assembler
  700. - SADE
  701. - SourceBug
  702. - ResEdit, MacsBug, Virtual User, BalloonWriter, etc.
  703. - Developer Essentials
  704. - Selected pre-release versions of tools
  705.  
  706. What's New on E.T.O #6?
  707. - MacApp 3.0b3
  708. - New final releases of MPW C, Pascal, Assembler, Rez, DeRez, and other MPW
  709.   components (in the Latest MPW folder)
  710. - C++ 3.2b3 (final candidate)
  711. - ToolServer 1.0b1
  712. - MPW QR6 (Quarterly Release #6)
  713. - SADE 1.3.1 final
  714. - SourceBug 1.0 final
  715. - Discipline 2.0.2 final
  716. - Virtual User 1.1 final
  717. - BallonWriter 1.0.1 final
  718. - draft chapters of a revised edition of Inside Macintosh
  719. - documentation on disc for SourceBug and a new MPW Command Reference
  720. - a new Apple Event Registry document on disc (Winter 1992 edition)
  721.  
  722.  
  723.  
  724.  
  725. - -------------------------
  726.  
  727. From: bear@csa.bu.edu (Blair M. Burtan)
  728. Subject:  ETO#6 ships (but no QuickTime)
  729. Date: 11 Feb 92 23:43:56 GMT
  730. Organization: Boston U. College of Engineering
  731.  
  732. Sigh.  I was looking forward to seeing some QuickTime stuff on this
  733. disk but alas Apple has decided not to include anything. Sniff Sniff.
  734. :-(
  735. --
  736. +---------------------------------------+
  737. + "If it isn't Baroque, don't fix it."  +
  738. +               - Beauty and The Beast  +
  739. +                        +
  740. + Blair M. Burtan: bear@bucsf.bu.edu    +
  741. +                  bear@bu-pub.bu.edu   +
  742. +---------------------------------------+
  743.  
  744.  
  745.  
  746.  
  747.  
  748. - -------------------------
  749.  
  750. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  751. Subject:  ETO#6 ships (but no QuickTime)
  752. Date: 12 Feb 92 01:42:47 GMT
  753. Organization: University of Waikato, Hamilton, New Zealand
  754.  
  755. In article <BEAR.92Feb11184356@csa.bu.edu>, bear@csa.bu.edu (Blair M. Burtan)
  756. complains about ETO #6 not containing any QuickTime stuff.
  757.  
  758. In that case, it looks like the only way to get the QuickTime documentation
  759. is still to buy the developer kit from APDA, though I sincerely hope the US$195
  760. price for this has some reasonable excuse, like royalties for the movies
  761. on the CD.
  762.  
  763. You'd think, though, that it would be possible for Apple to make the
  764. QuickTime documentation available on its own, at a much lower cost.
  765.  
  766. Lawrence, still waiting for his ETO #6.
  767.  
  768.  
  769.  
  770. - -------------------------
  771.  
  772. From: pope@daimi.aau.dk (Povl Hessellund Pedersen)
  773. Subject:  ETO#6 ships (but no QuickTime)
  774. Date: 12 Feb 92 17:18:29 GMT
  775. Organization: DAIMI: Computer Science Department, Aarhus University, Denmark
  776.  
  777. ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  778.  
  779. >In article <BEAR.92Feb11184356@csa.bu.edu>, bear@csa.bu.edu (Blair M. Burtan)
  780. >complains about ETO #6 not containing any QuickTime stuff.
  781.  
  782. >In that case, it looks like the only way to get the QuickTime documentation
  783. >is still to buy the developer kit from APDA, though I sincerely hope the US$195
  784. >price for this has some reasonable excuse, like royalties for the movies
  785. >on the CD.
  786.  
  787. there is a few megabytes of compressed QuickTime developer notes available
  788. on ftp.apple.com in a folder onder the QT folder. I have not looked at it,
  789. but I think most of it is sample code and interface documentation.
  790. The C package is 2+MB and the Pascal version << 1 MB.
  791.  
  792. Povl
  793. --
  794. Povl H. Pedersen (External student at dept. of CS, student at dept. economics)
  795. Macintosh programmer, consultant and technical support
  796. eco861771@ecostat.aau.dk   /   pope@daimi.aau.dk
  797.  
  798.  
  799.  
  800. ---------------------------
  801.  
  802. From: kovner@alf.cooper.edu (Scott_Kovner-(EE'90))
  803. Subject: Graf3d question
  804. Date: 5 Feb 92 03:14:25 GMT
  805. Organization: The Cooper Union ( NY, NY )
  806.  
  807. Where can I get documentation for Graf3d?
  808.  
  809. My compiler, THINK C, supplies the header files and libraries for
  810. what appears to be a 3d graphics package called graf3d, but no
  811. documentation.  I could use something of this sort.
  812.  
  813. Please email any info to kovner@marvin.cooper.edu
  814. My news server often drops messages, which my mailer doesn't.
  815.  
  816. I will post a summary if the info seems important.
  817.  
  818. Thank you very much.
  819.  
  820.                 Scott Kovner
  821.                 kovner@marvin.cooper.edu
  822.  
  823.  
  824.  
  825. - -------------------------
  826.  
  827. From: kovner@alf.cooper.edu (Scott_Kovner-(EE'90))
  828. Subject:  Graf3d
  829. Organization: The Cooper Union ( NY, NY )
  830. Date: Mon, 10 Feb 1992 23:14:48 GMT
  831.  
  832. Thank you to everyone who responded to my request for documentation on the
  833. library Graf3d.  The responses were very helpful.
  834.  
  835. Here is the most complte response.  Using the sample code therein, I was
  836. able to get a rotating cube on a Mac SE w/system 7 w/THINK C 5.0
  837.  
  838. One warning, the THINK C 5 doesn't appear to have a global variable
  839. thePort3D.  simply use your own 3D PortHndl to some space you declare instead.
  840. Also, I had to call InitGraf in addition to the 3d initialization stuff.
  841.  
  842. Thanx again to all of you.
  843.  
  844. >>From daemon Thu Feb  6 17:00 EST 1992
  845. >>From <busey@u.washington.edu>  Thu Feb  6 16:59:33 1992 remote from milton.u.washington.edu
  846. >Received: from milton.u.washington.edu by marvin.cooper.edu (5.61.3B2.1/1.34.1.2)
  847. >    id AA11194; Thu, 6 Feb 92 16:59:33 -0500
  848. >Received: by milton.u.washington.edu
  849. >    (5.65/UW-NDC Revision: 2.22 ) id AA12775; Thu, 6 Feb 92 14:30:28 -0800
  850. >Sender: busey@milton.u.washington.edu
  851. >Date: Thu, 6 Feb 1992 14:30:27 -0800 (PST)
  852. >From: Thomas Busey <busey@u.washington.edu>
  853. >Subject: graf3d docs
  854. >To: kovner@marvin.cooper.edu
  855. >Message-Id: <Pine.2.2.13.9202061440.A12293@milton.u.washington.edu>
  856. >Status: R
  857. >
  858. >Here are some docs that I downloaded some time ago.  The other info I
  859. >found is in the MPW manuals.
  860. >
  861. >Tom Busey
  862. >busey@u.washington.edu
  863. >Graf3D and What I Discovered Therein.
  864. >
  865. >
  866. >Some UseNetter's thought this might be beneficial to the net, so, here goes the
  867. >first installment of "Graf3D and What I Discovered Therein."  Feel free to
  868. >correct and dispute anything I say.  I'm not an expert programmer and only
  869. >stumbled through Graf3D a year and a half ago.  Also, sorry, I don't know C.
  870. >
  871. >"Graf3D and What I Discovered Therein - Part1"
  872. >==============================================
  873. >Here are the following functions/procedures and data types that Graf3D defines:
  874. >
  875. >Data Types:
  876. >  Fixed    (Essentially a LongInt <32-Bit> number where the high 16 bits
  877. >            represent the integer portion of the number and the low 16 bits
  878. >            represent the fractional portion of the number.  HiWord and LoWord
  879. >            can be used to extract said portions.  To convert a LongInt to a
  880. >            Fixed type, divide the LongInt by 65536 <2^16>)
  881. >
  882. >  Point3D   = RECORD
  883. >               x:Fixed;
  884. >               y:Fixed;
  885. >               z:Fixed;
  886. >            END;
  887. >           (Note: Unlike the Point type, h and v are called x and y <and z>
  888. >            and are of type Fixed instead of Integer.)
  889. >
  890. >  Point2D   = RECORD
  891. >               x:Fixed;
  892. >               y:Fixed;
  893. >            END;
  894. >           (Note: Why a Point2D and not just Point?  a- It uses the Fixed type
  895. >            variable, and b- It is thus easy to convert between a Point3D and
  896. >            Point2D for screen display.)
  897. >
  898. >  XfMatrix  = ARRAY [0..3, 0..3] of Fixed;
  899. >           (This is the transformation matrix that Graf3D uses to rotate and
  900. >            translate points.  If your familiar with the concepts and lingo
  901. >            used in 3D graphics, you'll know all about the transformation
  902. >            matrix.)
  903. >
  904. >  Port3DPtr = ^Port3D;
  905. >  Port3D    = RECORD
  906. >                GrPort: GrafPtr;
  907. >                viewRect: Rect;
  908. >                xLeft, yTop, xRight, yBottom: Fixed;
  909. >                pen, penPrime, eye: Point3D;
  910. >                hSize, vSize: Fixed;
  911. >                hCenter, vCenter: Fixed;
  912. >                xCotan, yCotan: Fixed;
  913. >                ident: Boolean;
  914. >                xForm: XfMatrix;
  915. >              END;
  916. >
  917. >           (I'll discuss each of these fields to the Port3D in the next
  918. >            installment.)
  919. >
  920. >  (Functions and Procedures)
  921. >
  922. >PROCEDURE InitGraf3D (GlobalPtr: Ptr);
  923. >
  924. >PROCEDURE Open3DPort (port: Port3DPtr);
  925. >
  926. >PROCEDURE SetPort3D (port: Port3DPtr);
  927. >
  928. >PROCEDURE GetPort3D (VAR port: Port3DPtr);
  929. >
  930. >PROCEDURE MoveTo2D (x, y: Fixed);
  931. >
  932. >PROCEDURE MoveTo3D (x, y, z: Fixed);
  933. >
  934. >PROCEDURE Move2D (dx, dy: Fixed);
  935. >
  936. >PROCEDURE Move3D (dx, dy, dz: Fixed);
  937. >
  938. >PROCEDURE LineTo2D (x, y: Fixed);
  939. >
  940. >PROCEDURE LineTo3D (x, y, z: Fixed);
  941. >
  942. >PROCEDURE Line2D (dx, dy: Fixed);
  943. >
  944. >PROCEDURE Line3D (dx, dy, dz: Fixed);
  945. >
  946. >FUNCTION Clip3D(src1, src2: Point3D; VAR dst1, dst2: Point);
  947. >
  948. >PROCEDURE SetPt3D (VAR pt3D: Point3D; x, y, z: Fixed);
  949. >
  950. >PROCEDURE SetPt2D (VAR pt2D: Point2D; x, y: Fixed);
  951. >
  952. >PROCEDURE ViewPort (r: Rect);
  953. >
  954. >PROCEDURE LookAt (left, top, right, bottom: Fixed);
  955. >
  956. >PROCEDURE ViewAngle (angle: Fixed);
  957. >
  958. >PROCEDURE Identity;
  959. >
  960. >PROCEDURE Scale (xFactor, yFactor, zFactor: Fixed);
  961. >
  962. >PROCEDURE Translate (dx, dy, dz: Fixed);
  963. >
  964. >PROCEDURE Pitch (xAngle: Fixed);
  965. >
  966. >PROCEDURE Yaw (yAngle: Fixed);
  967. >
  968. >PROCEDURE Roll (zAngle: Fixed);
  969. >
  970. >PROCEDURE Skew (zAngle: Fixed);
  971. >
  972. >PROCEDURE Transform (src: Point3D; VAR dst: Point3D);
  973. >
  974. >Whew!  That's it.  Most of this has come straight from the MPW documentation. 
  975. >I'll discuss each of these in following installments.  For now, you might note
  976. >that many of these have direct QuickDraw counterparts (SetPt, InitGraf, etc...)
  977. >that should make many of the procedures and functions almost self explanatory.
  978. >
  979. >Well, all for now!
  980. >
  981. >john calhoun
  982. >
  983. >
  984. >
  985. >Graf3D and What I Discovered Therein - part 2
  986. >
  987. >Yeah, part 1 was pretty much header info.  But, some people may not have it. 
  988. >Yes, I will present some code for setting up the 3D port and using it.  Wait
  989. >until about part 4 or 5 or so.  This is preliminary stuff to avoid a lot of
  990. >confusion later.
  991. >
  992. >The only variable type I skipped over last time was the Port3D record.  Here it
  993. >is described:
  994. >
  995. >Fields of the Port3D;
  996. >GPort      This is also documented as GrPort in the MPW docs.  In any event
  997. >           it is a pointer to the grafPort associated with the 3D port.  Thus
  998. >           standard Quickdraw calls to this port will show up with the 3D
  999. >           calls.  Want your 3D to appear white on black?  You can just
  1000. >           InvertRect the portRect field of the G(r)Port field of your Port3D.
  1001. >
  1002. >viewRect   Viewing rectangle within the grafPort.  In the 3D-way of describ-
  1003. >           ing a 'point of view', this rectangle corresponds to the base of
  1004. >           the pyramid formed by the user's "eye" and the four corners of the
  1005. >           screen.
  1006. >
  1007. >xLeft,     World coordinates corresponding to the viewRect.  You shouldn't
  1008. >yTop,      have to manipulate these variables directly.  The procedures for
  1009. >xRight,    setting up the camera take care of these.
  1010. >yBottom
  1011. >
  1012. >pen        Like the Quickdraw pen, but with 3 dimensional coordinates.
  1013. >
  1014. >penPrime   The pen location as transformed by the xForm matrix.  Thus, calls
  1015. >           to Yaw, Roll, etc will affect this pen's location.  Again, you
  1016. >           shouldn't have to manipulate this variable.
  1017. >
  1018. >eye        When you call ViewAngle, this variable is established.  It repres-
  1019. >           ents the 3D point in space where the apex of the viewing pyramid
  1020. >           is fixed.
  1021. >
  1022. >hSize,     This will store the half-width and half-height of the viewRect in
  1023. >vSize      screen coordinates.
  1024. >hCenter,   Center of the viewRect in screen coordinates.
  1025. >vCenter
  1026. >
  1027. >xCotan,    Graf3D sets these up as viewing cotangents (when you call ViewAngle)
  1028. >yCotan     for calls to Clip3D.
  1029. >
  1030. >Ident      When TRUE, the transforming routines are skipped.  This is set to
  1031. >           TRUE when you set the xForm matrix to the identity matrix (non-
  1032. >           rotated).
  1033. >
  1034. >xForm      This is a 4x4 matrix of variables for transforming points.  All
  1035. >           calls to Yaw(), Roll(), etc are applied to this matrix and then
  1036. >           Graf3D uses the matrix to transform points in space.  Unless
  1037. >           reset by Identity, this matrix will continue to represent the net
  1038. >           result of all transformation calls.
  1039. >
  1040. >Setting up a port:
  1041. >As with programs using Quickdraw, a call to IntGraf3D(@thePort3D) must be made
  1042. >during the initialization portion of your program.  Here is how I've
  1043. >initialized my 3D port:
  1044. >
  1045. >var
  1046. >  gPort3D                   :Port3D;
  1047. >  gPort3DPtr                :Port3DPtr;
  1048. >  origin                    :Point3D;
  1049. >  viewScreen                :Rect;
  1050. >
  1051. >begin
  1052. >  InitGraf3D(@thePort3D);
  1053. >  Open3DPort(@gPort3D);
  1054. >  SetRect(viewScreen,100, 20, 348, 144);
  1055. >  ViewPort(viewScreen);
  1056. >  LookAt(-983040, 655360, 983040, -655360);
  1057. >  ViewAngle(1604480);
  1058. >  SetPt3D(origin, 0, 0, 0);
  1059. >  gPort3D.eye:= origin;
  1060. >  FillRect(gPort3D.viewRect, black);
  1061. >  ...
  1062. >end;
  1063. >
  1064. >This will set up a small 248x124 3D port in the center of a 7-inch Mac screen. 
  1065. >As well, it sets the eye at the 'origin' in space looking straight ahead
  1066. >parallel to the "ground".  Finally it fills it black to look like outer space. 
  1067. >Those lengthy numbers used in LookAt and ViewAngle are fixed type numbers.  The
  1068. >ViewAngle (1604480) for example, represents an angle of 24 degrees
  1069. >(1604480/65536).
  1070. >Perhaps this is a good time to explain the view angles.  The view angle defines
  1071. >the amount of perspective given to 3D points and lines when drawn to the
  1072. >screen.  An angle of 0 represents no perspective (or orthographic) projection. 
  1073. >10 degrees is similar to the perspective seen through a telephoto lens, 25
  1074. >degrees is generally accepted as 'normal' perspective of the human eye, and 80
  1075. >degree would give you a distorted 'fisheye'-like wide angle perspective.
  1076. >
  1077. >Enough of Part 2.  Stay tuned for more.  Note: I can't get MAIL to work right. 
  1078. >I can READ but can't reply.
  1079. >
  1080. >john calhoun
  1081. >
  1082. >
  1083. >Graf3D and What I Discovered Therein - part3
  1084. >
  1085. >Well, I must say I'm posting this all a piece at a time.  I don't have any of
  1086. >this written all out in one place.  So if you want this, here it is, capture
  1087. >it.  Also, I'll say again that I am not an expert with this at all.  I have
  1088. >only experimented with it for a couple of months back when I was first learning
  1089. >to program the Mac (and learning Pascal too).  So, feel free to post
  1090. >corrections of any of my errors and take my 'tutorial' as a starting point
  1091. >only.  I just saw all the confusion about Graf3D and thought, "Well, I could
  1092. >explain a little bit of it."
  1093. >
  1094. >Drawing in 3D-
  1095. >
  1096. >As I may have hinted at before, all drawing is done 'wireframe' with Graf3D. 
  1097. >You set up a group of 3D points and use Move3D, MoveTo3D, LineTo3D, etc. to
  1098. >display your drawing.  I'm sure a guru could take the 2D equivalents of these
  1099. >screen points and create regions and paint them etc.  For my own purposes, this
  1100. >would clearly have been too slow.
  1101. >
  1102. >So, how did I optimize Graf3D within the bounds allowed by Graf3D?
  1103. >
  1104. >Setting up your 3D points-
  1105. >
  1106. >Consider a simple cube.  Counting up the vertices gives us 8 points.  If we set
  1107. >up an array [0..7] of Point3D, we can initialize all these points and then
  1108. >repeatedly connect-the-dots.  Calls to Yaw, Pitch, etc, and moving the 'eye'
  1109. >around in space will give us different views of this simple cube.
  1110. >
  1111. >The scale you use for the cube is fairly arbitrary.  Lets use a cube with a
  1112. >side of length 100 for simplicity.  In your initialization routine you caould
  1113. >call this:
  1114. >
  1115. >  var
  1116. >    cubeVertices: array [0..7] of Point3D;
  1117. >
  1118. >  begin
  1119. >    SetPoint3D(cubeVertices[0], 0, 0, 0);
  1120. >    SetPoint3D(cubevertices[1], 100, 0, 0);
  1121. >    SetPoint3D(cubeVertices[2], 100, 100, 0);
  1122. >    SetPoint3D(cubeVertices[3], 0, 100, 0);
  1123. >    SetPoint3D(cubeVertices[4], 0, 0, 100);
  1124. >    SetPoint3D(cubeVertices[5], 100, 0, 100);
  1125. >    SetPoint3D(cubeVertices[6], 100, 100, 100);
  1126. >    SetPoint3D(cubeVertices[7], 0, 100, 100);
  1127. >  ...
  1128. >  end;
  1129. >
  1130. >An alternate (and perhaps quicker) way of doing this would be to have set up an
  1131. >array of Fixed [0..7, 0..2].  This way, you never create the 3D points, but
  1132. >assign the x, y, and z coordinates of each verticee.  MoveTo3D and LineTo3D
  1133. >(etc) expect you to pass the fixed x, y, and z coordinates anyway.  Using
  1134. >Point3D's is convenient, but you'll still have to "dissect" the corrdinates out
  1135. >of these points when you call MoveTo3D, etc.
  1136. >
  1137. >A 'convenient' way around this hassle would be to create your own procedures:
  1138. >As an example:
  1139. >  Long way:
  1140. >
  1141. >    MoveTo3D(cubeVertices[i].x, cubeVertices[i].y, cubeVertices[i].z);
  1142. >
  1143. >  A nice procedure:
  1144. >
  1145. >    procedure MoveTo3DPt (thePoint: Point3D);
  1146. >    begin
  1147. >      MoveTo3D(thePoint.x, thePoint.y, thePoint.z);
  1148. >    end;
  1149. >
  1150. >    -now simply call-
  1151. >    MoveTo3DPt(cubeVertices[i]);
  1152. >
  1153. >I think I'll use this second way here.  (You could make a whole library of
  1154. >routines that translate 3D points, etc.)
  1155. >So, you've set up your 3D port (from part 2 of this little piece), and you've
  1156. >initialized the 8 vertices of your cube, - here is a simple loop to use the
  1157. >mouse to rotate the points from the perspective of the eye.
  1158. >
  1159. >var
  1160. >  mousePt:Point;     {A STANDARD QuickDraw point that is}
  1161. >
  1162. >{------}
  1163. >
  1164. >    procedure MoveTo3DPt (thePoint: Point3D);
  1165. >    begin
  1166. >      MoveTo3D(thePoint.x, thePoint.y, thePoint.z);
  1167. >    end;
  1168. >
  1169. >{------}
  1170. >
  1171. >    procedure LineTo3DPt (thePoint: Point3D);
  1172. >    begin
  1173. >      LineTo3D(thePoint.x, thePoint.y, thePoint.z);
  1174. >    end;
  1175. >
  1176. >{------}
  1177. >
  1178. >begin
  1179. >  ...
  1180. >  repeat
  1181. >    GetMouse(mousePt);
  1182. >    Roll((256 - mousePt.h) * 3276);  {3276 is about 1/10 of a degree, thus
  1183. >                                      on a 512 Mac screen, +/- 25 degrees
  1184. >                                      is your roll velocity}
  1185. >    origin.z:=origin.z+mousePt.v;    {We'll use the vertical position of the
  1186. >                                      mouse to change the z coordinate of
  1187. >                                      the origin (see part 2 for origin}
  1188. >    gPort3D.eye:=origin;             {Now we set the 'eye' of the 3D port
  1189. >                                      to the new location of the var origin}
  1190. >    FillRect(gPort3D.ViewRect, black);  {Erase other points drawn}
  1191. >    MoveTo3DPt(cubeVertices[0]);
  1192. >    LineTo3DPt(cubeVertices[1]);
  1193. >    LineTo3DPt(cubeVertices[2]);
  1194. >    LineTo3DPt(cubeVertices[3]);
  1195. >    LineTo3DPt(cubeVertices[0]);
  1196. >      {We have just drawn the bottom of the cube}
  1197. >    MoveTo3DPt(cubeVertices[4]);
  1198. >    LineTo3DPt(cubeVertices[5]);
  1199. >    LineTo3DPt(cubeVertices[6]);
  1200. >    LineTo3DPt(cubeVertices[7]);
  1201. >    LineTo3DPt(cubeVertices[4]);
  1202. >      {We have now drawn the top of the cube, now to connect the top & bot}
  1203. >    MoveTo3DPt(cubeVertices[0]);
  1204. >    LineTo3DPt(cubeVertices[4]);
  1205. >    MoveTo3DPt(cubeVertices[1]);
  1206. >    LineTo3DPt(cubeVertices[5]);
  1207. >    MoveTo3DPt(cubeVertices[2]);
  1208. >    LineTo3DPt(cubeVertices[6]);
  1209. >    MoveTo3DPt(cubeVertices[3]);
  1210. >    LineTo3DPt(cubeVertices[7]);
  1211. >  until button;     {clicking the mouse button exits the program}
  1212. >end.
  1213. >
  1214. >So, try that one out.  It's bits from a little test program I wrote.  You'll
  1215. >also have to have part 2 of my posts to do the port setting up stuff.  I'm
  1216. >hoping to that this is enough to get most everyone started.
  1217. >
  1218. >I could post more, but mostly program specific stuff.  I will say that my
  1219. >biggest annoyance with Graf3D was that it is difficult (impossible?) to
  1220. >actually rotate both the cube AND the eye at the same time.  As I recall,
  1221. >rotation calls to Yaw and the like actually rotate space about the point
  1222. >(0,0,0).  If you have, for example, two cubes located in differnt places in
  1223. >space, calls to pitch will rotate BOTH cubes teeter-totter like about the point
  1224. >(0,0,0) of space.  I could only imagine setting up SEPERATE 3D grafports for
  1225. >each cube and copybitting the two (via XOr) to a single 2D grafport on the
  1226. >screen.  Slow.
  1227. >
  1228. >If anyone has any questions, post them to the net (or mail me I suppose).  I
  1229. >can't reply to mail sent to me, but I could post more on a particular aspect of
  1230. >Graf3D to the net.
  1231. >
  1232. >One person mailed me about rotating 3D waveforms and displaying them.  That
  1233. >would probably be fairly easy to do given the code I've posted.  Define the
  1234. >waveform as a chain of 3D points stretching across the point (0,0,0).  Move the
  1235. >eye out away from (0,0,0) but look TOWARD the center of space.  Yaws and Rolls
  1236. >will gimble the waveform about.  Redraw (point to point) the waveform after
  1237. >each transformation.  You can scale the waveform by simply moving the eye of
  1238. >the 3D port toward and away from the center of space.
  1239. >
  1240. >Cheerio.  I'll check the net for requests.
  1241. >
  1242. >john calhoun
  1243. >
  1244. >
  1245. >
  1246.  
  1247.  
  1248.         Thanks
  1249.         Scott kovner@marvin.cooper.edu
  1250.  
  1251.  
  1252.  
  1253. ---------------------------
  1254.  
  1255. From: n9146269@animal.cc.wwu.edu (OverLord of Underlings)
  1256. Subject: TCL Application projects
  1257. Organization: Western Washington University
  1258. Date:  6 Feb 92 23:45:52 GMT
  1259.  
  1260. I am creating my first full macintosh interface application. It is a 
  1261. "war-dialer" a modem utility that dials a multitude of phone #s and 
  1262. records which ones have modems answer. This program will have MANY options 
  1263. that the plethora of IBM dialers don't as well as a mac interface...
  1264.  
  1265. I am new at this, and have chosen this project as my first as it incorporates
  1266. many things that I think are necessary to learn sooner or later. Scrolling
  1267. lists, dialogs, file input and output, serial drivers etc...
  1268.  
  1269. One thing though that I am interested in is the use of the TCL... I am 
  1270. learning smalltalk at this very moment and loving it, OOP is very intuitive.
  1271. Should I convert my current program from C to Thinks OOP with the TCL?
  1272.  
  1273. What do you think are the benefits/problems with using TCL?
  1274.  
  1275. RWD
  1276. _O_
  1277.  |
  1278.  
  1279.  
  1280.  
  1281.  
  1282. - -------------------------
  1283.  
  1284. From: n9146269@animal.cc.wwu.edu (OverLord of Underlings)
  1285. Subject: TCL Application projects II
  1286. Organization: Western Washington University
  1287. Date:  6 Feb 92 23:51:00 GMT
  1288.  
  1289. I would like to see the SMALLEST and simplist appliaction using TCL for 
  1290. Think C 4.0... if you ahve an example that you think is a good role modal,
  1291. please stuff, binhex and mail it to me... I would deeply appreciate having
  1292. someone give me a little push in the right direction...
  1293.  
  1294. RWD
  1295. _O_
  1296.  |
  1297.  
  1298.  
  1299.  
  1300.  
  1301. - -------------------------
  1302.  
  1303. From: mbabramowicz@amherst.edu
  1304. Subject:  TCL Application projects
  1305. Date: 10 Feb 92 12:11:57 GMT
  1306. Organization: Amherst College, Amherst, MA.
  1307.  
  1308. In article <n9146269.697419952@animal>, n9146269@animal.cc.wwu.edu (OverLord of Underlings) writes:
  1309. > I am creating my first full macintosh interface application. It is a 
  1310. > "war-dialer" a modem utility that dials a multitude of phone #s and 
  1311. > records which ones have modems answer. This program will have MANY options 
  1312. > that the plethora of IBM dialers don't as well as a mac interface...
  1313.  
  1314.  Well if I answer my phone and get an annoying beeping noise, I'll
  1315.  know whom to blame.
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321. - -------------------------
  1322.  
  1323. From:  (Chris Ellens)
  1324. Subject:  TCL Application projects
  1325. Date: 11 Feb 92 22:26:41 GMT
  1326. Organization: Bell-Northern Research
  1327.  
  1328. In article <n9146269.697419952@animal>, n9146269@animal.cc.wwu.edu (OverLord of Underlings) writes:
  1329. > I am creating my first full macintosh interface application. It is a 
  1330. > "war-dialer" a modem utility that dials a multitude of phone #s and 
  1331. > records which ones have modems answer. 
  1332.  
  1333. For the sake of all of us who answer our phones only to hear the irritating
  1334. silence of a modem waiting for carrier.... I hope you never get your first
  1335. full mac application working. Who exactly are you at war with, anyway?
  1336.  
  1337. ..Chris
  1338.  
  1339.  
  1340.  
  1341. - -------------------------
  1342.  
  1343. Organization: Penn State University
  1344. Date: Tuesday, 11 Feb 1992 20:15:54 EST
  1345. From: Christopher Tate <CXT105@psuvm.psu.edu>
  1346. Subject:  TCL Application projects
  1347.  
  1348. In article <n9146269.697419952@animal>, n9146269@animal.cc.wwu.edu (OverLord of
  1349. Underlings) says:
  1350. >
  1351. >I am creating my first full macintosh interface application. It is a
  1352. >"war-dialer" a modem utility that dials a multitude of phone #s and
  1353. >records which ones have modems answer. This program will have MANY options
  1354. >that the plethora of IBM dialers don't as well as a mac interface...
  1355.  
  1356. Be warned:  I've heard it stated that such "war dialers" (named for the
  1357. film "War Games," I believe) are illegal in many places, possibly in the
  1358. U.S.A. in general.  Corollary: don't mess around with the Phone Company.
  1359. If they find you've been calling a large number of telephone numbers for
  1360. brief periods of time, they're going to get more than a little upset.
  1361.  
  1362. Indeed; many states are making it illegal for telephone solicitations to
  1363. use machines to do their message-spouting; they require that there be a
  1364. Real Live Human doing the soliciting.
  1365.  
  1366. - -----
  1367. Christopher Tate     | Cryptogram #11:
  1368. cxt105@psuvm.psu.edu |
  1369. CXT105@PSUVM.BITNET  | "KOI SDXG EDKZZ QXKS SDXMN EAHNIE MOSH CZHAEDKNXE,
  1370. - -------------------|  YHN MY GHV DMS K BKO AMSD K CZHAEDKNX, DX'E UHMOU
  1371. Send me the answer!  |  SH TOHA DX'E QXXO DMS."   (QNVFX DHVZS)
  1372.  
  1373.  
  1374.  
  1375. ---------------------------
  1376.  
  1377. From: pope@daimi.aau.dk (Povl Hessellund Pedersen)
  1378. Subject: DiskVars / JRdData  ($22E)
  1379. Date: 8 Feb 92 01:38:20 GMT
  1380. Organization: DAIMI: Computer Science Department, Aarhus University, Denmark
  1381.  
  1382. I am currently hacking around in some old code, that will no longer
  1383. run on current machines. I am thus trying to remove the check for the
  1384. master disk.  MacNosy disassembles something into the label
  1385. DiskVar+JRdData  (address is $22E).  TMON Pro lists this as JRdData,
  1386. but I would like to know what this global does/is/points to or whatever.
  1387. I could not find anything in Inside Mac I-IV.
  1388.  
  1389. BTW: This copy protection will also crash on the 68040 based machines,
  1390. it contains self modifying code. One place it reserves about 1k of
  1391. memory, fills it up with NOP and ending with RTS. Then it calls this
  1392. as a subroutine. I guess this is a hack to make the 68030 refill its
  1393. instruction cache with the modified code upon return. But it is not
  1394. very nice done.
  1395. --
  1396. Povl H. Pedersen (External student at dept. of CS, student at dept. economics)
  1397. Macintosh programmer, consultant and technical support
  1398. eco861771@ecostat.aau.dk   /   pope@daimi.aau.dk
  1399.  
  1400.  
  1401.  
  1402. - -------------------------
  1403.  
  1404. From: stevec@Apple.COM (Steve Christensen)
  1405. Subject:  DiskVars / JRdData ($22E)
  1406. Date: 11 Feb 92 03:40:19 GMT
  1407. Organization: Apple Computer Inc., Cupertino, CA
  1408.  
  1409. pope@daimi.aau.dk (Povl Hessellund Pedersen) writes:
  1410. >I am currently hacking around in some old code, that will no longer
  1411. >run on current machines. I am thus trying to remove the check for the
  1412. >master disk.  MacNosy disassembles something into the label
  1413. >DiskVar+JRdData  (address is $22E).  TMON Pro lists this as JRdData,
  1414. >but I would like to know what this global does/is/points to or whatever.
  1415. >I could not find anything in Inside Mac I-IV.
  1416.  
  1417. Sigh.  Another copy protection scheme bites the dust.  OK, not that I
  1418. should talk about it, but the aforementioned location is a vector to
  1419. the floppy disk driver's routine to read the data portion of a disk
  1420. sector.  Copy protection schemes have often patched that routine
  1421. (temporarily) so they can read the disk their own way to determine
  1422. if a signature is on the disk.  Note that at least a couple of Macs
  1423. ignore that vector, so whatever other skanky things were being done,
  1424. reading from the disk wasn't going to be one of them.
  1425.  
  1426. steve
  1427.  
  1428. -- 
  1429. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1430.   Steve Christensen            Never hit a man with glasses.
  1431.   stevec@apple.com            Hit him with a baseball bat.
  1432.  
  1433.  
  1434.  
  1435. ---------------------------
  1436.  
  1437. From: bj646@cleveland.Freenet.Edu (Thomas James Vilot)
  1438. Subject: My INIT and cdev don't talk to each other!
  1439. Date: 9 Feb 92 21:50:37 GMT
  1440. Organization: Case Western Reserve University, Cleveland, Ohio, (USA)
  1441.  
  1442.  
  1443. I am having a problem getting an init and cdev to talk 
  1444. with one another. I want to use Gestalt to create a new 
  1445. selector code, and have my functionreturn the address of 
  1446. the data in memory. However, when i do a NewGestalt,i get
  1447. an error that the routine is not in the system heap. But I 
  1448. know itis because that is where it is loading at boot time. 
  1449.  
  1450. What's the problem?? Is there an easier way to do this? 
  1451.  
  1452. Thanx in advance.
  1453.  
  1454. cahan@bigboy.cis.temple.edu
  1455.  
  1456.  
  1457. -- 
  1458. Thomas J. Vilot        aka: vilot@bigboy.cis.temple.edu
  1459. Jeffersonville, PA    Near Valley Forge, Pennsylvania
  1460.  
  1461.  
  1462.  
  1463. - -------------------------
  1464.  
  1465. From: bj646@cleveland.Freenet.Edu (Thomas James Vilot)
  1466. Subject: INIT and CDEV communication (was: My Init and cdev...)
  1467. Date: 10 Feb 92 22:48:46 GMT
  1468. Organization: Case Western Reserve University, Cleveland, Ohio, (USA)
  1469.  
  1470.  
  1471. In a prvious post, I asked if anyone knew how to get an INIT and
  1472. cdev to talkt to each other. Having not been very explicit about
  1473. the problem, I thought I should follow up:
  1474.  
  1475.  
  1476. > Why don't you post a code excerpt?  You haven't given us much to work 
  1477.  
  1478. > with.
  1479. > -- 
  1480. >   -- Jim Walker 76367.2271@compuserve.com  walkerj@math.scarolina.edu
  1481.  
  1482. Here is some of the code i am using to try to pass
  1483. information between my init and cdev.
  1484.  
  1485. the call below is done in the init with the selector
  1486. function in the same file.
  1487.  
  1488.       NewGestalt(kOurCreat, mySelectorFunction);
  1489.  
  1490.  
  1491.       OSErr mySelectorFunction(OSType selector, long *response)
  1492.       {
  1493.               *response = (long) address_of_data_to_pass;
  1494.  
  1495.       }
  1496.  
  1497.  
  1498. the routine below is used to get the address of the data.
  1499.  
  1500.      Ptr FindInitData()
  1501.      {
  1502.         long                addr;
  1503.         
  1504.         Gestalt(kOurCreat,&addr);
  1505.         return((Ptr) addr);
  1506.  
  1507.      }
  1508.  
  1509.  
  1510. The question is, why does NewGestalt return the an error
  1511. which says the routine is not in the system heap??
  1512. And is there an easier way to do this (i was using a
  1513. little hack that checked the heap for a specific
  1514. string, but that breaks in 32bit mode)
  1515.  
  1516. Thanx in advance!
  1517.  
  1518. Jim Walker, and all, I hope this explains it a little better.
  1519. You are all actually getting this post from two people
  1520. so this could get confusing. I am forwarding posts for
  1521. cahan@bigboy.cis.temple.edu since Temple University can't
  1522. seem to get their damnable act together and get news 
  1523. posting to work. But, we are both working on this same
  1524. project.
  1525.  
  1526. -- 
  1527. Thomas J. Vilot                 "Blessings of the masses,
  1528. vilot@bigboy.cis.temple.edu     "Blessings of the State...
  1529. Jeffersonville, PA              "Buy. Buy more. Buy now..." -THX1138
  1530.  
  1531.  
  1532.  
  1533. - -------------------------
  1534.  
  1535. From: neeri@iis.ethz.ch (Matthias Ulrich Neeracher)
  1536. Subject:  INIT and CDEV communication (was: My Init and cdev...)
  1537. Date: 11 Feb 92 16:48:38 GMT
  1538. Organization: Integrated Systems Laboratory, ETH, Zurich
  1539.  
  1540. In article <1992Feb10.224846.2000@usenet.ins.cwru.edu> bj646@cleveland.Freenet.Edu (Thomas James Vilot) writes:
  1541. >Here is some of the code i am using to try to pass
  1542. >information between my init and cdev.
  1543. >the call below is done in the init with the selector
  1544. >function in the same file.
  1545. >      NewGestalt(kOurCreat, mySelectorFunction);
  1546. >      OSErr mySelectorFunction(OSType selector, long *response)
  1547. >      {
  1548. >              *response = (long) address_of_data_to_pass;
  1549. >      }
  1550. >the routine below is used to get the address of the data.
  1551. >     Ptr FindInitData()
  1552. >     {
  1553. >        long                addr;
  1554. >        
  1555. >        Gestalt(kOurCreat,&addr);
  1556. >        return((Ptr) addr);
  1557. >     }
  1558. >The question is, why does NewGestalt return the an error
  1559. >which says the routine is not in the system heap??
  1560.  
  1561. Probably because the routine *is* not in the system heap. Have you checked that
  1562. ? By default, INITs are loaded into the application heap, and I wouldn't trust
  1563. the resSysHeap flag for things like this.
  1564.  
  1565. >And is there an easier way to do this (i was using a
  1566. >little hack that checked the heap for a specific
  1567. >string, but that breaks in 32bit mode)
  1568.  
  1569. This should work if you don't rely on the structure of heap blocks but do a
  1570. brute force search (this is not as slow as it sounds). But if Gestalt is
  1571. implemented, it is the better way to use.
  1572.  
  1573. Matthias
  1574.  
  1575. - ---
  1576. Matthias Neeracher                                      neeri@iis.ethz.ch
  1577.  `We say "gestalt" when things combine to act in ways we can't explain'
  1578.                              -- Marvin Minsky, _The Society Of Mind_
  1579.  
  1580.  
  1581.  
  1582. ---------------------------
  1583.  
  1584. End of C.S.M.P. Digest
  1585. **********************
  1586.